<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Category List</title>
<style>
html, body {
height: 100%;
width: 100%;
}
.white_content {
display: none;
position: absolute;
top: 25%;
left: 25%;
width: 50%;
padding:10px;

border: 8px solid blue;
z-index:1002;
}
.black_overlay {
display: none;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color:#f5f5f5;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.close {
float:right;
clear:both;
width:100%;
text-align:right;
margin:0 0 6px 0
}
.close a {
color:#333;
text-decoration:none;
font-size:14px;
font-weight:700
}
.con {
text-indent:20px;
line-height:10px;
}
</style>
<script>
function show(tag){
var light=document.getElementById(tag);
var fade=document.getElementById('fade');
light.style.display='block';
fade.style.display='block';
}
function hide(tag){
var light=document.getElementById(tag);
var fade=document.getElementById('fade');
light.style.display='none';
fade.style.display='none';
}
</script> 
</head>

<body style="font-family:Arial, Helvetica, sans-serif; font-size:12px;">
<h2>Upload Person File</h2>
<h3><span style = "color:red">(Please name your file format as id_TypeFile_No._xxxxxx.xxx)<br/>
Current valid file type are (Contract,Payslip,WarningLetter)</span></h3>
<h3>Name:<?php echo $this->staffName;?></h3>

<table border="1" cellspacing="0" cellpadding="10">
	<tr>
		<th>Category</th>
		<th>File Title</th>
		<th>Upload File</th>
	</tr>
	<?php if($this->filelist != null){?>
	<?php foreach($this->filelist as $k => $v){
			$file = new Model_DbTable_Roster_StaffFile();
			$fileType = $file->getFileType($k);?>
			
	<tr>
		<td><?php echo $fileType['title_type'];?></td>
		<td>
	<?php 
		foreach($v as $k2 => $v2){?>
		<?php echo $k2+1;?>.<a href = "http://192.168.1.124/personFile/<?php echo $v2?>" target="_blank"><?php echo $v2;?></a><br/>
		<?php 	}?>
		</td>
		<td><input type = "submit" name = "upload_file" id = "upload_file" value = "Upload" onclick="show('light')"></input></td>
	</tr>
	
	<?php }
	}else{?>
	<tr>
		<td colspan = "3"><input type = "submit" name = "upload_file" id = "upload_file" value = "Upload" onclick="show('light')"></input></td>
	</tr>
	<?php }?>
</table>

<div id="light" class="white_content">
      <div class="close"><a href="javascript:void(0)" onclick="hide('light')"> Close</a></div>
<form action = "" method = "post" enctype="multipart/form-data"> 
      <div class="con">
      	<h2>Please Upload your file here</h2>
      	<label for="my_file"></label>
		<input type ="file" name = "my_file" id = "my_file"></input>
		<input type ="submit" name = "upload" id = "upload" value = "Upload"></input>
      </div>
</form>     
</div>

<div id="fade" class="black_overlay"></div> 


</body>
</html>
